package com.shop2cn.iapi.sellerpromotion.service;

import java.util.List;

import com.google.gson.reflect.TypeToken;
import com.shop2cn.iapi.sellerpromotion.parameter.ConflictProduct;
import com.shop2cn.iapi.sellerpromotion.parameter.PromotionListVo;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.EnvSetup;
/**
*获取冲突商品列表
*FreeMaker Template自动生成代码
*/
public class GetConflictProductsCall extends YmatouBaseCall{
	private static String opurl ="manage/getConflictProducts";
	
	public GetConflictProductsCall() {
		super(EnvSetup.getSystemUrl("sellerpromotion_shop2cn_iapi"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	public List<ConflictProduct> getConflictProductList() {
		List<ConflictProduct> data = null;
        try {
        	String data2=getJsonObject().get("data").getAsJsonObject().get("conflictProductList").toString();
        	data=(List<ConflictProduct>) FormatUtil.GSONToObject(data2, new TypeToken<List<ConflictProduct>>() {}.getType());
        } catch (Exception e) {
            e.printStackTrace();
        }
        return data;
	}
}